import Vuex from 'vuex'
import axios from '../../http/http'

const store = {
    namespaced: true,
    state(){
        return {
            menuList: []
        }
    },
    mutations:{
        menuListMutations(state,menuList){
            state.menuList = menuList
        }
    },
    actions:{
        menuListAction(context){
            axios.get("/menulist").then(
                res=>{
                    if(res.status==200){
                        const data = res.data.list
                        context.commit("menuListMutations",data)
                    }
                }
            )
        }
    },
    getters:{

    }
}

export default store